using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using SiteManager;

public partial class Directory_DoctorList : System.Web.UI.Page
{
    protected localFunction obj = new localFunction();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (RewriteModule.RewriteContext.Current.Params["state"] != null && RewriteModule.RewriteContext.Current.Params["city"] != null && RewriteModule.RewriteContext.Current.Params["specility"] != null)
        {

            //Response.Write(ReplaceUrl(RewriteModule.RewriteContext.Current.Params["state"].ToString().Trim()).ToString().Trim());
            //Response.Write(ReplaceUrl(RewriteModule.RewriteContext.Current.Params["city"].ToString().Trim()).ToString().Trim());
            //Response.Write(ReplaceUrl(RewriteModule.RewriteContext.Current.Params["specility"].ToString().Trim()).ToString().Trim());

            //lblMsg.Text = "";

            SqlParameter[] sqlParam = new SqlParameter[4];
            sqlParam[0] = new SqlParameter("@Action", SqlDbType.Int);
            sqlParam[0].Value = 3;
            sqlParam[1] = new SqlParameter("@state", SqlDbType.VarChar, 100);
            sqlParam[1].Value = ReplaceUrl(RewriteModule.RewriteContext.Current.Params["state"].ToString().Trim()).ToString().Trim();
            sqlParam[2] = new SqlParameter("@city", SqlDbType.VarChar, 100);
            sqlParam[2].Value = ReplaceUrl(RewriteModule.RewriteContext.Current.Params["city"].ToString().Trim()).ToString().Trim();
            sqlParam[3] = new SqlParameter("@specility", SqlDbType.VarChar, 100);
            sqlParam[3].Value = ReplaceUrl(RewriteModule.RewriteContext.Current.Params["specility"].ToString().Trim()).ToString().Trim();
            cntPaging.SqlParameterList = sqlParam;
            
        }
    }

    protected string getUrl(object st) // Changed on July 27,2007 by ad 
    {
        return st.ToString().Replace(" & ", " and ").Replace(" ", "_").ToLower().Replace(",", "-or-");

    }
    protected string ReplaceUrl(object st)
    {
        return st.ToString().Replace("_and_", "_&_").Replace("_", " ").Replace("-or-", ",");
    }
}
